<?php
	if(!MB_admin){
		exit();
	}
	$wid =(int) $_GET['wid'];
	$wallAct = new MBWall($host,$root,$pwd,$db);
	$rets = $wallAct->showMsg($p,10,$wid);
	@include_once(MB_ADMIN_DIR.'/data/wall.php');
	$walllist = $wall['list'];
?>
	<div class="table_header">
		<div>
			查看话题墙:
			<select id="actList">
				<option value="0" <?if($wid == 0){echo 'selected';}?> >所有消息</option>
	  			<?foreach($walllist as $key => $b){?>
				<option value="<? echo $b['id'];?>" <?if($wid == $b['id']){echo 'selected';}?>><? echo $b['text'];?></option>
				<?}?>
			</select>
		</div>
		<?if($rets['count']>0){?>
		<table cellpadding="3" cellspacing="0" border="0" width="600">
			<tr>
				<th>消息预览</th>
				<th>话题名</th>
				<th>添加时间</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
	  		<?foreach($rets['list'] as $key => $b){?>
			<tr>
				<td><?php echo $b['text'];?></td>
				<td><?php echo $b['tit'];?></td>
				<td><?php echo date('Ymd',$b['addtime']);?></td>
				<td>
					<?php
						if($b['status']){
							echo '通过';
						}else{
							echo '未通过';
						}
					?>
				</td>
				<td>
					<?php
						if($b['status']){
					?>
						<a href="admin_recomm_act.php?a=wall&id=<?php echo $b['id'];?>&wid=<?php echo $b['wid'];?>&s=0">审核不通过</a>
					<?php
						}else{
					?>
						<a href="admin_recomm_act.php?a=wall&id=<?php echo $b['id'];?>&wid=<?php echo $b['wid'];?>&s=1">审核通过</a>
					<?php
						}
					?>
				</td>
			</tr>
			<?}?>
		</table>
		<?}else{?>
		<div class="nodata">还没有数据</div>
		<?}?>
<?php
	$pages = new MBPage('admin_recomm.php?cid='.$cindex,$rets['count'],$p,10);
    $pages->showpage();
?>
	</div>
	<script>
	$('#actList').change(function(){
		var v = $(this).val();
		window.location = 'admin_recomm.php?cid=<? echo $cindex;?>&wid='+v;	
	});
	</script>
